<?php

namespace app\posapi\validate;

use think\Validate;

class SellPos_NewDbid extends Validate
{
    protected $rule = [

        // 'type' => 'require|in:A1,B1,C1', // 系统单号-前缀-`type` '单据类型_A1销售B1退货C1赠送'
        'operator' => 'require', //门店操作员
        // 'sign' => 'require', //改单签名串
        // "table_detail" =>  "require|array|length:1,999", //表格商品数组
        // 'user_type' => 'require|in:user,agent,admin',
    ];
    protected $message = [
        'type' => '单据类型-type',
        'operator' => '门店操作员-operator',
        'sign' => '改单签名串-sign',
        'table_detail' => '表格商品数组-table_detail',
        // 'user_type.require' => '帐号类型必须', //帐号类型admin总部agent代理user一般用户
        // 'user_type.in' => '帐号类型仅限:user,agent,admin', //帐号类型admin总部agent代理user一般用户
    ];

    // 自定义验证方法-帐号类型
    protected function userType($value, $rule, $requestdb)
    {
        // dump($value);
        // dump($rule);
        // dump($requestdb);
    }
}
